package com.it.web;

import com.it.entity.denial.Rejection;
import com.it.service.RejectionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import utils.R;

/**
 * <p>
 * 拒赔表 前端控制器
 * </p>
 *
 * @author yzy
 * @since 2025年09月25日
 */
@RestController
@RequestMapping("/rejection")
public class RejectionController {
    @Autowired
    private RejectionService rejectionService;
    //拒赔添加（返回应该包括报案编号（必须返回），立案号/核赔号，保单号,拒赔原因，操作员id）
    @PostMapping("/addRejection")
    public R addRejection(@RequestBody Rejection rejection){
        return rejectionService.addRejection(rejection);
    }

    //审核拒赔
    @PutMapping("/examineRejection")
    public R examineRejection(@RequestBody Rejection rejection){
        return rejectionService.examineRejection(rejection);
    }

    //获取拒赔列表
    @GetMapping("RejectionList")
    public R RejectionList(@RequestParam(value = "pageNum",required = false,defaultValue = "1") int pageNum,
                           @RequestParam(value = "pageSize",required = false,defaultValue = "5") int pageSize,
                           @RequestParam(value = "reportNo",required = false) String reportNo,
                           @RequestParam(value = "rejectStatus",required = false) Integer rejectStatus){
        return rejectionService.pagelist(pageNum,pageSize,reportNo,rejectStatus);
    }
}
